<div class="alert alert-warning"><!--{if $_G['setting']['fileVersion']}-->当前管理员设置了最多保留{$_G['setting']['fileVersionNumber']}个历史版本。<!--{else}-->当前管理员已关闭历史版本功能，不再生成历史版本。<!--{/if}--></div>
<!--{if $fileinfo['editperm'] && $_G['setting']['fileVersion'] && ($_G['setting']['fileVersionNumber'] == 0 || $_G['setting']['fileVersionNumber'] > $versionnums )}-->
<div class="upload d-grid">
    <button type="button" class="btn btn-outline-primary" title="{lang upload_update}">
        <span class="mdi mdi-file-upload"></span> {lang upload_update}
        <input type="file" name="files[]" class="version_upload_file" onclick="historyupload(this,'{$fileinfo['rid']}')"/>
    </button>
</div>
<!--{/if}-->
<ul class="list-group mb-3">
<!--{if $versions}-->
    <!--{loop $versions $v}-->
    <li class="list-group-item d-flex justify-content-between align-items-start version_menu version_{$v[vid]}">
        <div class="unameMenu-upload">
            <div class="fw-bold text-truncate"><!--{if !$v['vname']}-->$v['username']<!--{else}-->$v[vname]<!--{/if}--></div>
            <!--{if $v['vdesc']}--><span class="form-text text-truncate">$v['vdesc']</span><!--{/if}-->
            <div class="versioninfos">
                {eval echo dgmdate($v['dateline'],'Y-m-d H:i:s');}
                <!--{if $fileinfo['vid'] == $v['vid']}--><span class="badge badge-outline-primary">{lang principal_edition}</span><!--{/if}-->
            </div>
        </div>
        <span class="editMenu">{eval echo formatsize($v['size']);}</span>
        <a href="javascript:;" class="group-editMenu dropdown-toggle fs-5" data-toggle="dropdown"></a>
        <ul class="dropdown-menu dropdown-menu-version">
            <li>
                <a class="dropdown-item" href="javascript:;" data-rid="$v[rid]" data-vid="$v[vid]" onclick="infoversion(this)"><i class="mdi mdi-information-variant"></i><span class="file-text">{lang version_information}</span></a>
            </li>
            <li>
                <a href="javascript:;" class="view_versions dropdown-item" data-dpath="$fileinfo[dpath]" data-vid="$v[vid]" onclick="viewversion(this)">
                    <i class="mdi mdi-eye"></i><span class="file-text">{lang view_version}</span>
                </a>
            </li>
            <!--{if $fileinfo['editperm']}-->
            <!--{if $v[vid]}-->
            <li>
                <a href="javascript:;" class="primary_versions dropdown-item" data-rid="$fileinfo[rid]" data-vid="$v[vid]" <!--{if $fileinfo['vid'] == $v['vid']}-->data-primary="yes"<!--{else}--> data-primary="no"<!--{/if}--> onclick="primaryVersion(this)"><i class="mdi mdi-flare"></i><span class="file-text">{lang sign_principal_edition}</span></a>
            </li>
            <!--{/if}-->
            <li>
                <a href="javascript:;" class="edit_versions dropdown-item" data-rid="$fileinfo[rid]" data-vid="$v[vid]" onclick="editVersionName(this)">
                    <i class="mdi mdi-pencil"></i><span class="file-text">{lang edit_version_information}</span>
                </a>
            </li>
            <!--{if $v[vid]}-->
            <li>
                <a href="javascript:;" class="delete_versions dropdown-item" data-rid="$fileinfo[rid]" data-vid="$v[vid]" onclick="deletethisversion(this)">
                    <i class="mdi mdi-delete"></i><span class="file-text">{lang delete_this_version}</span>
                </a>
            </li>
            <!--{/if}-->
            <!--{/if}-->
        </ul>
    </li>
    <!--{/loop}-->
    <!--{else}-->
    <li class="list-group-item d-flex justify-content-between align-items-start version_menu version_0">
        <div class="unameMenu-upload">
            <div class="fw-bold text-truncate">$fileinfo['username']</div>
            <div class="versioninfos">
                {eval echo dgmdate($fileinfo['dateline'],'Y-m-d H:i:s');}
                <span class="badge badge-outline-primary">{lang principal_edition}</span>
            </div>
        </div>
        <a href="javascript:;" class="group-editMenu dropdown-toggle fs-5" data-toggle="dropdown"></a>
        <ul class="dropdown-menu dropdown-menu-version">
            <li><a class="dropdown-item" href="javascript:;" data-rid="$fileinfo[rid]" data-vid="$fileinfo[vid]" onclick="infoversion(this)"><i class="mdi mdi-information-variant"></i><span class="file-text">{lang version_information}</span></a></li>
            <li>
                <a href="javascript:;" class="view_versions dropdown-item" data-dpath="$fileinfo[dpath]" data-vid="$fileinfo[vid]" onclick="viewversion(this)">
                    <i class="mdi mdi-eye"></i><span class="file-text">{lang view_version}</span>
                </a>
            </li>
            <li>
                <a href="javascript:;" class="primary_version dropdown-item" data-rid="$fileinfo[rid]" data-vid="$fileinfo[vid]" data-primary="yes" onclick="primaryVersion(this)">
                    <i class="mdi mdi-flare"></i><span class="file-text">{lang sign_principal_edition}</span>
                </a>
            </li>
            <li>
                <a href="javascript:;" data-rid="$fileinfo[rid]" class="edit_versions dropdown-item" data-vid="$fileinfo[vid]" onclick="editVersionName(this)">
                    <i class="mdi mdi-pencil"></i><span class="file-text">{lang edit_version_information}</span>
                </a>
            </li>
        </ul>
    </li>
<!--{/if}-->
</ul>
$multi
<!--{if $vnext}-->
<div class="mb-1 d-grid">
    <a href="javascript:;" class="btn btn-link btn-sm text-end" onclick="jQuery('.version-tab').click();">{lang upload_more}</a>
</div>
<!--{/if}-->